#!/bin/bash
OPENSOURCE_DIR=$(dirname $0)
if [ -f "$OPENSOURCE_DIR/opensource.mk" -a -f "$OPENSOURCE_DIR/clean" ]; then
	echo "press any key to continue cleaning opensource in:"
	echo "$OPENSOURCE_DIR"
	echo "or press CTRL+C to quit"
	read any
else
	echo "opensource path is wrong:$OPENSOURCE_DIR"
	exit 1
fi
##################################
#####  指定编译目录
##################################
SQLITE_DIR=$OPENSOURCE_DIR/sqlite-3871
CURL_DIR=$OPENSOURCE_DIR/curl-7.42.1
CJSON_DIR=$OPENSOURCE_DIR/cJSON
TINYXML_DIR=$OPENSOURCE_DIR/tinyxml-2.6.2
LIBCONFIG_DIR=$OPENSOURCE_DIR/libconfig-1.4.9
LOG4Z_DIR=$OPENSOURCE_DIR/log4z
TINYALSA_DIR=$OPENSOURCE_DIR/tinyalsa

RM=/bin/rm
${RM} -rf $OPENSOURCE_DIR/output/*
##################################
####  clean sqlite
##################################
cd $SQLITE_DIR
make clean
find ./ -name .deps -exec rm -rf {} \;
cd ..

##################################
####  clean curl
##################################
cd $CURL_DIR
make clean
find ./ -name .deps -exec rm -rf {} \;
cd ..

##################################
####  clean cjson
##################################
cd $CJSON_DIR
make clean
cd ..

##################################
####  clean tinyxml
##################################
cd $TINYXML_DIR
make clean
cd ..

##################################
####  clean log4z
##################################
cd $LOG4Z_DIR
make clean
cd ..

##################################
####  clean libconfig
##################################
cd $LIBCONFIG_DIR
make clean
find ./ -name .deps -exec rm -rf {} \;
cd ..

##################################
####  clean tinyalsa
##################################
cd $TINYALSA_DIR
make clean
cd ..
